package it.infodea.tapestrydea.services;

import it.infodea.tapestrydea.services.pageinfo.impl.PageInfoAccessControlDispatcher;

import org.apache.tapestry5.ioc.ObjectLocator;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.services.ComponentClassResolver;
import org.apache.tapestry5.services.Dispatcher;

public class PageInfoModule {

	public static Dispatcher buildPageInfoAccessControlDispatcher(ComponentClassResolver resolver, UserSecurityLevelProvider levelProvider) {
		return new PageInfoAccessControlDispatcher(resolver, levelProvider);
	}

	public void contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration, ObjectLocator locator) {
		configuration.add("pageInfoAccessControl", locator.getService("PageInfoAccessControlDispatcher", Dispatcher.class),
				"before:PageRender", "after:Asset");
	}

}
